#ifndef ___SOFT_TIMER_H
#define ___SOFT_TIMER_H 	

#include "main.h"
#include "stdio.h"	

#define TIME_NUM	256

typedef struct
{
	uint16_t set_time;
	uint16_t cur_time;
	uint8_t  start_bit:1;
	uint8_t  time_up:1;
	uint8_t  cb_bit:1;
} SOFT_TIMER;

typedef void (*callback_func)();

extern SOFT_TIMER sptime[TIME_NUM];

void soft_timer_enable(uint16_t timenum,uint16_t delay);
void soft_timer_disble(uint16_t timenum);
void soft_timer_process();

void soft_timer_single(uint16_t timenum,uint16_t delay,callback_func callback);
void soft_timer_cycle(uint16_t timenum,uint16_t delay,callback_func callback);
#endif